package com.guan.study.easyExcelDemo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.alibaba.excel.enums.poi.BorderStyleEnum;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.guan.study.easyExcelDemo.utils.CustomConverter;
import com.guan.study.easyExcelDemo.utils.CustomConverter2;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.util.Date;

/**
 * @Date: 2023/7/2 10:17
 * @Author: yaobai
 * @Description:
 */
@Data
@SuperBuilder
@NoArgsConstructor
@ApiModel(value="EduTeacher对象", description="讲师")
//内容样式
@ContentStyle(
        horizontalAlignment = HorizontalAlignmentEnum.CENTER,
        verticalAlignment = VerticalAlignmentEnum.CENTER,
        borderTop = BorderStyleEnum.THIN,
        borderBottom = BorderStyleEnum.THIN,
        borderLeft = BorderStyleEnum.THIN,
        borderRight = BorderStyleEnum.THIN)
//表头行高
@HeadRowHeight(30)
//内容单元格行高
@ContentRowHeight(25)
public class Teacher  {

    @ApiModelProperty(value = "工号")
    @ExcelIgnore //忽略 不参与导入导出
    @ColumnWidth(20)
    private String id;

    @ApiModelProperty(value = "所属学院, 0 科技学院,1 交通学院, 2 医学院")
    @ExcelProperty(value = "所属学院", converter = CustomConverter.class)
    @ColumnWidth(20)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private String school;

    @ApiModelProperty(value = "工号")
    @ExcelProperty(value = "工号")
    @ColumnWidth(20)
    private String workNo;

    @ApiModelProperty(value = "讲师姓名")
    @ColumnWidth(20)
    @ExcelProperty(value = "讲师姓名")
    private String name;

    @ApiModelProperty(value = "讲师简介")
    @ExcelProperty(value = "讲师简介")
    @ColumnWidth(20)
    private String intro;

    @ApiModelProperty(value = "讲师资历,一句话说明讲师")
    @ExcelProperty(value = "讲师资历")
    @ColumnWidth(20)
    private String career;

    @ApiModelProperty(value = "头衔 1高级讲师 2首席讲师")
    @ExcelProperty(value = "头衔")
    @ColumnWidth(20)
    private Integer level;

    @ApiModelProperty(value = "讲师头像")
    @ExcelProperty(value = "讲师头像")
    @ColumnWidth(20)
    private String avatar;

    @ApiModelProperty(value = "排序")
    @ExcelProperty(value = "排序")
    @ColumnWidth(20)
    private Integer sort;

    @ApiModelProperty(value = "逻辑删除 1（true）已删除， 0（false）未删除")
    @ExcelProperty(value = "逻辑删除", converter = CustomConverter2.class)
    @ColumnWidth(20)
    private Boolean isDeleted;

    @ApiModelProperty(value = "创建时间")
    @ExcelProperty(value = "创建时间")
    @ColumnWidth(20)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date gmtCreate;

    @ApiModelProperty(value = "更新时间")
    @ExcelProperty(value = "更新时间")
    @ColumnWidth(20)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date gmtModified;


}
